﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ShredTheLog.Common.MVVM;
using System.Reflection;
using ShredTheLog.Common;
using System.Windows.Input;

namespace ShredTheLog.ViewModels
{
    public sealed class AboutViewModel : ViewModelBase
    {
        private VersionInfo _versionInfo = new VersionInfo();

        public string Product
        {
            get { return _versionInfo.Product; }
        }

        public string Copyright
        {
            get { return _versionInfo.Copyright; }
        }

        public string Version
        {
            get { return _versionInfo.Version; }
        }

        public bool IsWindowClosed
        {
            get { return _isWindowClosed; }
            set { _isWindowClosed = value; OnPropertyChanged(() => IsWindowClosed); }
        }
        private bool _isWindowClosed;

        private ICommand _closeCommand;
        public ICommand CloseCommand
        {
            get
            {
                if (_closeCommand == null)
                {
                    _closeCommand = new DelegateCommand(() => { IsWindowClosed = true; });
                }
                return _closeCommand;
            }
        }
    }
}
